package com.mxprojects.gui
{
	import com.mxprojects.io.Config;
	import com.mxprojects.language.Word;
	import com.mxprojects.views.*;
	
	import flash.external.ExternalInterface;
	
	public class Resizer
	{		
		private static const BUFFER_HEIGHT:int = 30; //How much to show after the content and the footer
		
		public function Resizer(){}
		
		public static function resizeContent():void {
			//take care of the header
			MXP3.header.resize();
			
			//handle the disabler if it's up as well
			if(MXP3.disabler != null){
				MXP3.disabler.width = MXP3.wStage;
				MXP3.disabler.height = MXP3.hStage;
			}
			
			if(MXP3.loadingAni != null){
				MXP3.loadingAni.resize();
			}
			
			//handle the resize of whatever section we are in
			switch(MXP3.currentLocation){
				case Word.FORUMS:
					Forums.resize();
				break;
				
				case Word.THREADS:
					Threads.resize();
				break;
				
				case Word.POSTS:
					Posts.resize();
				break;
				
				case Word.PROFILE:
				case Word.REGISTER:
					Register.resize();
				break;
				
				case Word.SEARCH:
					Search.resize();
				break;
			}
			
			//the footer
			MXP3.footer.resize();
			
			//set the min height this bad boy should be
			MXP3.canvas.minHeight = String(MXP3.header.height + MXP3.contentHolder.height + MXP3.footer.height + BUFFER_HEIGHT);
		}
		
	}
}